
var open = require("helper/open");

ui("$").setMapping({
	"layoutRoot.tag": "id",
	"labelGradeCodeLv.tag": "gradeCode",
	"labelGradeCodeLv.text": "gradeCodeLv",
    "labelGradeName.text": "gradeName",
    "labelGradeName.tag": "isUsed"
});

//点击一个等级
ui("$").on("touch", function(data){
	var id = ui("layoutRoot").tag;
	if(id != null){
		open.open("source://view/circle/base/manageOne/memberGradeEdit.ui",{id:id});
	}
});

ui("$").on("dataRefreshed", function(){
	var isUsed = ui("labelGradeName").tag;
	if(isUsed=="1"){//已启用
		ui("layoutRoot").bgColor ="FFFFFFFF";
	}else if(isUsed=="2"){//已停用
		ui("layoutRoot").bgColor ="CACACAFF";
	}else{
		ui("layoutRoot").bgColor ="FFFFFFFF";
	}
});